<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\recruitmentEnterprise\model;

use plugin\saiadmin\basic\BaseNormalModel;

/**
 * 招聘企业模型
 */
class recruitmentEnterprise extends BaseNormalModel
{

    /**
     * 数据表主键
     * @var string
     */
    protected $pk = 'enterprise_id';

    /**
     * 数据库表名称
     * @var string
     */
    protected $table = 'eb_recruitment_enterprise';

    
    /**
     * 招聘企业 搜索
     */
    public function searchEnterpriseNameAttr($query, $value)
    {
        $query->where('enterprise_name', 'like', '%'.$value.'%');
    }


    /**
     * 关联模型recruitmentEnterprise
     */
    public function recruitmentEnterprise()
    {
        return $this->hasOne(recruitmentEnterprise::class, 'enterprise_id', 'enterprise_id');
    }


}
